<?php
define('ACC', true);
require('./include/init.php');
session_start(); 
//print_r($_SESSION);
$userid = $_SESSION['user_id'];
//$userid = 26;

$company = new companymodel();
$companyinfo = $company->getcompanyinfo($userid);
$companyid = $companyinfo['company_id']; 
$company_y = $companyinfo['company_y'];
$company_q = $companyinfo['company_q'];


//$loaninfo = $company->getallelements($companyid, 'loan');
$loaninfo = $company->getloan($companyid);  
//$loanlist = $company->getelementlist('loan');


echo  '<div id = "loanupdate"><table class="table table-bordered">';
echo '<tr><td>期限</td><td>贷款类别</td><td>金额</td></tr>';

foreach($loaninfo as $k=>$v){
    $elementname = $company->getelementname($v['element_id']);
    echo '<tr><td>' . $v['duration'] . '</td><td>' . $elementname . '</td><td>' . $v['current_value'] . '</td></tr>';
}    
echo '</table></div>';
 
?>
